import request from '@/utils/request'

export function login(username, password) {
  return request({
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/umc/oauth/form',
    auth: {
      username: 'spring-cloud-gateway',
      password: '123456'
    },
    params: {
      username: username,
      password: password
    }
  })
}

export function getInfo(access_token) {
  return request({
    url: '/umc/user/currentUser',
    method: 'get',
    params: { access_token }
  })
}

export function logout(access_token) {
  return request({
    url: '/umc/logout',
    method: 'post',
    params: { access_token }
  })
}
